aaa = {'name': 'asd', 'age': 34}

print(aaa.items())
print("@" * 30)
# 单独遍历取得是key
for i in aaa:
    print(i)

print("@" * 30)
for i in aaa.items():
    print(i)

print("@" * 30)
for key, value in aaa.items():
    print(key, value)

print('*' * 40)
dict1 = {'name': 'qq', 'age': 'asda'}

print(dict1.keys())
print(dict1.values())
print(dict1.items())

print('aa' in dict1)
print('name' in dict1)
# get不会报错 dict['asda'] 取不到会报错
# print(dict1['asda'])
print(dict1.get('name', 'asfaf'))
print(dict1.get('naaame', 'asfaf'))
# dict_keys(['name', 'age'])
# dict_values(['asda', 'asda'])
# dict_items([('name', 'asda'), ('age', 'asda')])
# False
# True

print('*' * 35)
# 删除dict
dict2 = {'name': 'qq', 'age': 'asda'}
del dict2['name']
print(dict2)
print()
# 没有remove方法   可以 pop(key,[,default])
dict3 = {'a': 10, "b": "asd", 'c': 23}
result = dict3.pop('a')
print(dict3)
print(result)

# popitem() 随机 删除 一般删除最后
dict3.popitem()
print(dict3)
'''
update(dict) 合并更新
dict + dict1 报错

fromkeys()

'''

print('^' * 70)
print('^' * 70)
print('^' * 70)
print('^' * 70)
for i in range(255):
    if ((i % 100 == 0) and (i != 0)):
        print(chr(i))
    else:
        print(chr(i), end='')

        # 鿆鿇鿈鿉鿊鿋鿌鿍鿎鿏鿐

print('^' * 70)
print('^' * 70)
print('^' * 70)
print('^' * 70)
a = b'ABCDEF'
print(a)
print('ABCD'.encode('ascii'))

print('-' * 90)

python11 = set(['a', 'b', 'c', 'd'])
c11 = set(['x', 'y', 'c', 'd'])

print(python11 & c11)
print(python11 | c11)
print(python11 - c11)
print(python11 ^ c11)

str = 'a b c d e f >>> www.baidu.com'

print(str.split())

print(str.split(" ", 3))
